#define _CRT_SECURE_NO_WARNINGS 1

#include"string.h"

void Tstring1()
{
	claffic::string s1("hello world");
	cout << s1.c_str() << endl;

	for (size_t i = 0; i < s1.size(); i++)
	{
		cout << s1[i] << " ";
	}
	cout << endl;

	//myname::string::iterator it = s1.begin();
	auto it = s1.begin();

	while (it != s1.end())
	{
		cout << *it << " ";
		++it;
	}
	cout << endl;

	for (auto ch : s1)
	{
		cout << ch << " ";
	}
	cout << endl;
}

void Tstring2()
{
	claffic::string s1("hello world");
	cout << s1.c_str() << endl;

	s1.push_back(' ');
	s1.push_back('#');
	s1.append("abcdef");

	cout << s1.c_str() << endl;
}

void Tstring3()
{
	claffic::string s1("hello world");
	cout << s1.c_str() << endl;

	s1 += ' ';
	s1 += '#';
	s1 += "abcdef";

	cout << s1.c_str() << endl;
}

void Tstring4()
{
	claffic::string s1("helloworld");
	cout << s1.c_str() << endl;

	//s1.insert(5, 3, '#');

	//s1.insert(0, 3, '#');
	//s1.insert(5, "***");
	s1.insert(0, "&&&");

	cout << s1.c_str() << endl;
}

void Tstring5()
{
	claffic::string s1("helloworld");
	cout << s1.c_str() << endl;

	s1.erase(5, 3);
	//s1.erase(5);

	cout << s1.c_str() << endl;
}

void Tstring6()
{
	claffic::string s1("helloworld");
	cout << s1.c_str() << endl;

	cout << s1.find('h', 6) << endl;
	cout << s1.find("owo") << endl;

}

void Tstring7()
{
	claffic::string s1("helloworld");
	cout << s1.c_str() << endl;

	cout << s1.substr().c_str() << endl;
	cout << s1.substr(2,5).c_str() << endl;

}

void Tstring8()
{
	claffic::string s;
	cin >> s;
	cout << s << endl;

	cin >> s;
	cout << s << endl;
}

void Tstring9()
{
	claffic::string s1 = "abcde";
	claffic::string s2 = "Abcde";
	cout << (s1 == s2) << endl;
}

void Tstring10()
{
	claffic::string s1 = "abcde";
	claffic::string s2 = "fgh";
	s1 = s2;

	cout << s1 << endl;
}

int main()
{
	//Tstring1();
	//Tstring2();
	//Tstring3();
	//Tstring4();
	//Tstring5();
	//Tstring6();
	//Tstring7();
	//Tstring8();
	//Tstring9();
	Tstring10();


	return 0;
}